<div class="container">
  <div class="module-title">
    <div class="flag"></div>
    {{title}}
  </div>

  <form class="form-content" nz-form [formGroup]="validateForm" (ngSubmit)="submitForm(validateForm.value)">
    <div nz-row>
      <div nz-col nzSpan=12>
        <nz-form-item>
          <nz-form-label [nzSpan]="7" nzRequired>单位名称</nz-form-label>
          <nz-form-control [nzSpan]="14" [nzErrorTip]="userErrorTpl">
            <input nz-input formControlName="name" placeholder="请输入单位名称" />
            <ng-template #userErrorTpl let-control>
              <ng-container *ngIf="control.hasError('required')">请输入单位名称</ng-container>
              <ng-container *ngIf="control.hasError('pattern')">单位名称不能全为空格</ng-container>
            </ng-template>
          </nz-form-control>
        </nz-form-item>
      </div>
      <div nz-col nzSpan=12>
        <nz-form-item>
          <nz-form-label [nzSpan]="7" nzRequired>单位类型</nz-form-label>
          <nz-form-control [nzSpan]="14">
            <nz-select nzShowSearch nzAllowClear formControlName="orgType">
              <nz-option nzLabel="法人组织" nzValue="法人组织"></nz-option>
              <nz-option nzLabel="其他组织" nzValue="其他组织"></nz-option>
              <nz-option nzLabel="自然人" nzValue="自然人"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>

    <div nz-row>
      <div nz-col nzSpan=12>
        <nz-form-item>
          <nz-form-label [nzSpan]="7">所属行业</nz-form-label>
          <nz-form-control [nzSpan]="14" [nzErrorTip]="userErrorTpl">
            <nz-select formControlName="industry" nzShowSearch nzAllowClear nzPlaceHolder="">
              <nz-option [nzLabel]="item" [nzValue]="item" *ngFor="let item of industryList"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
      </div>
      <div nz-col nzSpan=12>
        <nz-form-item>
          <nz-form-label [nzSpan]="7">上游行业</nz-form-label>
          <nz-form-control [nzSpan]="14">
            <nz-select formControlName="upstreamIndustry" nzShowSearch nzAllowClear nzPlaceHolder="">
              <nz-option [nzLabel]="item" [nzValue]="item" *ngFor="let item of industryList"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>

    <div nz-row>
      <div nz-col nzSpan=12>
        <nz-form-item>
          <nz-form-label [nzSpan]="7">下游行业</nz-form-label>
          <nz-form-control [nzSpan]="14" [nzErrorTip]="userErrorTpl">
            <nz-select formControlName="downstreamIndustry" nzShowSearch nzAllowClear nzPlaceHolder="">
              <nz-option [nzLabel]="item" [nzValue]="item" *ngFor="let item of industryList"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
      </div>
      <div nz-col nzSpan=12>
        <nz-form-item>
          <nz-form-label [nzSpan]="7">使用系统模板</nz-form-label>
          <nz-form-control [nzSpan]="14">
            <nz-select nzMode="multiple" formControlName="systemTypes">
              <nz-option nzLabel="供应商服务系统" nzValue="供应商服务系统"></nz-option>
              <nz-option nzLabel="内控管理系统" nzValue="内控管理系统"></nz-option>
            </nz-select>
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>

    <div nz-row>
      <div nz-col nzSpan=12>
        <nz-form-item>
          <nz-form-label [nzSpan]="7">使用有效期</nz-form-label>
          <nz-form-control [nzSpan]="14">
            <nz-range-picker [ngModelOptions]="{standalone: true}" [(ngModel)]="postageTime" style="width: 100%;"
              (ngModelChange)="onDateChange($event)"></nz-range-picker>
          </nz-form-control>
        </nz-form-item>
      </div>

    </div>

    <div nz-row>
      <div nz-col nzSpan=12>
        <nz-form-item>
          <nz-form-label [nzSpan]="7">资费标准</nz-form-label>
          <nz-form-control [nzSpan]="14">
            <input nz-input formControlName="postage" />
          </nz-form-control>
        </nz-form-item>
      </div>
      <div nz-col nzSpan=12>
        <nz-form-item>
          <nz-form-label [nzSpan]="7">特别说明</nz-form-label>
          <nz-form-control [nzSpan]="14">
            <input nz-input formControlName="specialNote" />
          </nz-form-control>
        </nz-form-item>
      </div>
    </div>


    <div class="ac-panel">
      <button nz-button (click)="goBack()">取消</button>
      <button nz-button nzType="primary" class="ml20" type="submit" (click)="confirm()">确定</button>
    </div>

  </form>
</div>